<!DOCTYPE html>
<html lang="en">
<head>
    <title>kafka_test</title>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,shrink-to-fit=no">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script>

        function current() {
            var d = new Date(),
                str = '';
            str += d.getFullYear() + '-';
            str += d.getMonth() + 1 + '-';
            str += d.getDate() + ' ';
            str += d.getHours() + ':';
            str += d.getMinutes() + ':';
            str += d.getSeconds();
            return str;
        }

        function operate(action) {

            var json = {
                'user_id': 'tp_user',
                'act_time': current().toString(),
                'action': action,
                'job_code': 'tp_job'
            };

            $.ajax({
                type: "POST",
                url: "http://linux124/kafka/send/tp_individual",
                dataType: "json",
                crossDomain: true,
                data: JSON.stringify(json),
                success: function (data) {
                    alert("success")
                },
                error: function (data) {
                    alert("success")
                }
            })
        }
    </script>
</head>
<body>
<div class="row" style="text-align: center">
    <div>
        <button type="button" id="click" onclick="operate('click')">点击</button>
    </div>
    <div>
        <button type="button" id="job_collect" onclick="operate('job_collect')">收藏职位</button>
    </div>
    <div>
        <button type="button" id="resume_send" onclick="operate('cv_send')">投递简历</button>
    </div>
    <div>
        <button type="button" id="resume_upload" onclick="operate('cv_upload')">上传简历</button>
    </div>
</div>
</body>
</html>